<?php
session_start();
?>
<?php
$username=$_POST['username'];
$password=$_POST['password'];

$myusername = stripslashes($username);
$mypassword = stripslashes($password);
$myusername = mysql_real_escape_string($username);
$mypassword = mysql_real_escape_string($password);

$connect = mysql_connect("localhost","root","toor") or die ("Connection error");
	mysql_select_db('fp') or die ("Couldn't find DB'");
	
$sql="SELECT * FROM user WHERE username='$username' and password='$password'";
$result=mysql_query($sql);
$count=mysql_num_rows($result);

if (!$_POST['username'] | !$_POST['password'] ) {

 		die('You did not complete all of the required fields');

 	}

if ($count==1){
	
	session_register("username");
	session_register("password");
	header("location: index.php?/atriun/home");
}
else
	die("Please enter username and password")
?>
